<template>
  <div>
    <Mobile v-if="isMobileTerminal" :categoryData="categoryData"></Mobile>
    <PC v-else></PC>
  </div>
</template>

<script setup>
import { isMobileTerminal } from '@/utils/flexible.js'
import Mobile from './mobile/index.vue'
import PC from './pc/index.vue'
import { useStore } from 'vuex'

const store = useStore()
// 触发 category 数据获取动作
store.dispatch('category/useCategoryData')

// const categoryData = ref([])
// const getCategoryData = async () => {
//   const result = await getCategory()
//   categoryData.value = result.categorys
//   categoryData.value.unshift(ALL_CATEGORY_ITEM)
// }
// getCategoryData()
</script>

<style lang="scss" scoped></style>
